package model.interactionhandler;

import model.entity.Entity;
import model.entity.Mountable;
import model.entity.MountableNPC;
import model.entity.brain.DumbBrain;
import model.map.World;

/**
 * This class is for handling the avatar mounting an basicEntity
 * @author Vincent
 *
 */
public class MountHandler extends InteractionHandler{
	
	public MountHandler(String theName) {
		super(theName);
	}

	public void mount(Entity ent, MountableNPC theMount){
		theMount.mount(ent);
		theMount.getBrain().cancelBrainFunctioning();
		theMount.setBrain(new DumbBrain(theMount));
		InteractionContainer.getInstance().clear();
	}
	
	public void unmount(Entity ent, Mountable theMount){
		theMount.unmount(ent);
		InteractionContainer.getInstance().clear();
		theMount.setLocation(World.getInstance().getPlayer().getLocation());
	}
}